#include <stdio.h>
#include <string.h>

//初始化
typedef void(*init_CSocketProtocol)(void **handler);
//发送接口
typedef void(*send_CSocketProtocol)(void *handler, unsigned char* sendData, int sendLen);
//接收接口
typedef void(*recv_CSocketProtocol)(void *handler, unsigned char* recvDate, int* recvlen);
//关闭
typedef void(*close_CSocketProtocol)(void *handler);

//业务代码
void framework(init_CSocketProtocol init,
	       send_CSocketProtocol send,
	       recv_CSocketProtocol recv,
	       close_CSocketProtocol close)
{
	void *handle = NULL;
	init(handle);

	char buf[] = "aaabbcdd";
	int sendLen = strlen(buf);
	send(handle, buf, sendLen);

	char recvBuf[1024] = {0};
	int recvLen = 0;
	recv(handle, recvBuf, &recvLen);

	close(handle);
	handle = NULL;
}

int main(int argc, char const *argv[])
{
	return 0;
}
